﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using LTP.Accounts.Bus;
namespace MidSoft.Sys
{
    public partial class UserInfo : System.Web.UI.Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    int UsersId = (Convert.ToInt32(strid));
                    ShowInfo(UsersId);
                }
            }
        }

        private void ShowInfo(int UsersId)
        {
            ChinaSoft.BLL.BLL_tb_MidSoft_Users bll = new ChinaSoft.BLL.BLL_tb_MidSoft_Users();
            ChinaSoft.Model.Model_tb_MidSoft_Users model = bll.GetModel(UsersId);
            ChinaSoft.BLL.Common.Bind bllBind = new ChinaSoft.BLL.Common.Bind();
            System.Data.DataSet ds=bllBind.GetDataSet("*", "V_UserList", "UsersId=" + UsersId);
            if (ds != null && ds.Tables.Count > 0)
            {
                System.Data.DataRow dr = ds.Tables[0].Rows[0];
                this.lblUserAccount.Text = dr["UserAccount"].ToString();
                this.lblUserName.Text = dr["UserName"].ToString();
                if (!string.IsNullOrEmpty(dr["UserImgFolder"].ToString()))
                    this.ImgHeader.ImageUrl = "/Uploads/" + dr["UserImgFolder"].ToString() + "/" + dr["UserImgPath"].ToString();
                else
                    this.ImgHeader.ImageUrl = "/Uploads/" + dr["UserImgPath"].ToString();
                this.lblCompany.Text = dr["Company"].ToString();
                this.lblDepartMent.Text = dr["DepartMent"].ToString();
                this.lblSex.Text = dr["Sex"].ToString();
                this.lblBirthDay.Text = Convert.ToDateTime(dr["BirthDay"].ToString()).ToShortDateString();
                this.lblTel.Text =dr["Tel"].ToString();
                this.lblDuty.Text =dr["Duty"].ToString();
                this.lblCreateTime.Text =dr["CreateTime"].ToString();
                this.lblState.Text = ChinaSoft.Common.Input.SetInt(dr["State"]) == 0 ? "启用" : "禁用";
                this.lblRoleName.Text = dr["RoleName"].ToString();
            }
        }
    }
}